// JavaScript Document

$(function(e) {
	
	cover();
	$(window).resize(function(e) {   //浏览器窗口变化
        cover();
    });

    function cover(){
		var win1_height =  $(window).height()-52;
		$('.leftbar_box').css({"height":win1_height,"background-color":"#353f4b"});

		var main1_height = $(window).height()-97;
		$(".J_iframe").height(main1_height);
	}

	$("#side-menu").metisMenu();

	function toggleAnimate(){
		($(".leftbar_box").width()==68)?($(".leftbar_box").animate({width:"190px"},"800"),$(".right_box .content").animate({marginLeft:"190px"})):($(".leftbar_box").animate({width:"68px"},"800"),$(".right_box .content").animate({marginLeft:"68px"}));
	}

	function lefterBarHideFade(){
		$(".leftbar_box_con").hide(), setTimeout(function() {
			$(".leftbar_box_con").fadeIn(500)
		}, 300);
	}

	$('.leftbar-extend > a').click( function() {
		$("body").toggleClass("mini-navbar");
		lefterBarHideFade();
		toggleAnimate();
	});


	$('#side-menu li >a').click( function(){
		if($("body").hasClass("mini-navbar")){
			$("body").removeClass("mini-navbar");
			lefterBarHideFade();
			toggleAnimate();
		}
	});

	$(".leftbar_box_con").slimScroll({height:"100%",opacity: .4,railOpacity:.9});

})
